.class public Lcom/glympse/platform/common/OAuthJob;
.super Lcom/glympse/platform/common/HttpJob;
.source "OAuthJob.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/platform/common/OAuthJob$CompareNameValueNodes;
    }
.end annotation


# instance fields
.field private m_strAuthorizationHeader:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 22
    invoke-direct {p0}, Lcom/glympse/platform/common/HttpJob;-><init>()V

    .line 24
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/OAuthJob;->m_strAuthorizationHeader:Ljava/lang/String;

    .line 22
    return-void
.end method

.method public static OAuthEncode(Ljava/lang/String;)Ljava/lang/String;
    .locals 9
    .parameter "str"

    .prologue
    const/16 v8, 0x30

    .line 185
    invoke-static {p0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 187
    const-string v6, ""

    .line 242
    :goto_0
    return-object v6

    .line 194
    :cond_0
    new-instance v5, Ljava/lang/StringBuffer;

    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuffer;-><init>(I)V

    .line 201
    .local v5, strbuf:Ljava/lang/StringBuffer;
    :try_start_0
    const-string v6, "UTF-8"

    invoke-virtual {p0, v6}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    .line 204
    .local v0, abUTF8:[B
    const/4 v2, 0x0

    .local v2, nByte:I
    :goto_1
    array-length v6, v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-lt v2, v6, :cond_1

    .line 242
    .end local v0           #abUTF8:[B
    .end local v2           #nByte:I
    :goto_2
    invoke-virtual {v5}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v6

    goto :goto_0

    .line 208
    .restart local v0       #abUTF8:[B
    .restart local v2       #nByte:I
    :cond_1
    :try_start_1
    aget-byte v6, v0, v2

    and-int/lit16 v3, v6, 0xff

    .line 212
    .local v3, nChar:I
    const/16 v6, 0x41

    if-lt v3, v6, :cond_2

    const/16 v6, 0x5a

    if-le v3, v6, :cond_5

    .line 213
    :cond_2
    const/16 v6, 0x61

    if-lt v3, v6, :cond_3

    const/16 v6, 0x7a

    if-le v3, v6, :cond_5

    .line 214
    :cond_3
    if-lt v3, v8, :cond_4

    const/16 v6, 0x39

    if-le v3, v6, :cond_5

    .line 215
    :cond_4
    const/16 v6, 0x2d

    if-eq v3, v6, :cond_5

    .line 216
    const/16 v6, 0x2e

    if-eq v3, v6, :cond_5

    .line 217
    const/16 v6, 0x5f

    if-eq v3, v6, :cond_5

    .line 218
    const/16 v6, 0x7e

    if-ne v3, v6, :cond_6

    .line 221
    :cond_5
    int-to-char v6, v3

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 204
    :goto_3
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 227
    :cond_6
    const/16 v6, 0x25

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 228
    const/16 v6, 0x10

    invoke-static {v3, v6}, Ljava/lang/Integer;->toString(II)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;

    move-result-object v4

    .line 229
    .local v4, strChar:Ljava/lang/String;
    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v6

    const/4 v7, 0x2

    if-ge v6, v7, :cond_7

    .line 231
    const/16 v6, 0x30

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 233
    :cond_7
    invoke-virtual {v5, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_3

    .line 237
    .end local v0           #abUTF8:[B
    .end local v2           #nByte:I
    .end local v3           #nChar:I
    .end local v4           #strChar:Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 239
    .local v1, e:Ljava/lang/Exception;
    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_2
.end method


# virtual methods
.method public AddRequestHeaders(Lcom/glympse/platform/GHttpConnection;)V
    .locals 2
    .parameter "oHttpConn"

    .prologue
    .line 171
    iget-object v0, p0, Lcom/glympse/platform/common/OAuthJob;->m_strAuthorizationHeader:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 173
    const-string v0, "Authorization"

    iget-object v1, p0, Lcom/glympse/platform/common/OAuthJob;->m_strAuthorizationHeader:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 175
    :cond_0
    invoke-virtual {p0}, Lcom/glympse/platform/common/OAuthJob;->IsPost()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 177
    const-string v0, "Content-Type"

    const-string v1, "application/x-www-form-urlencoded"

    invoke-virtual {p1, v0, v1}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 179
    :cond_1
    const-string v0, "Connection"

    const-string v1, "close"

    invoke-virtual {p1, v0, v1}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 180
    return-void
.end method

.method public PreProcess()V
    .locals 0

    .prologue
    .line 165
    invoke-virtual {p0}, Lcom/glympse/platform/common/OAuthJob;->DumpUpload()V

    .line 166
    return-void
.end method

.method public SendOAuthRequest(ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/glympse/platform/GVector$NameValueNodes;)V
    .locals 19
    .parameter "fUseAuthHeader"
    .parameter "strUrl"
    .parameter "strConsumerKey"
    .parameter "strConsumerSecret"
    .parameter "strToken"
    .parameter "strTokenSecret"
    .parameter

    .prologue
    .line 36
    .local p7, listNameValues:Lcom/glympse/platform/GVector$NameValueNodes;,"Lcom/glympse/platform/GVector$NameValueNodes;"
    new-instance v14, Ljava/lang/StringBuffer;

    invoke-direct {v14}, Ljava/lang/StringBuffer;-><init>()V

    .line 37
    .local v14, strbufPost:Ljava/lang/StringBuffer;
    new-instance v5, Lcom/glympse/platform/GVector$NameValueNodes;

    invoke-direct {v5}, Lcom/glympse/platform/GVector$NameValueNodes;-><init>()V

    .line 40
    .local v5, listParams:Lcom/glympse/platform/GVector$NameValueNodes;,"Lcom/glympse/platform/GVector$NameValueNodes;"
    if-eqz p7, :cond_1

    .line 43
    invoke-virtual/range {p7 .. p7}, Lcom/glympse/platform/GVector$NameValueNodes;->elements()Ljava/util/Enumeration;

    move-result-object v4

    .local v4, iter:Ljava/util/Enumeration;
    :cond_0
    :goto_0
    invoke-interface {v4}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v15

    if-nez v15, :cond_2

    .line 71
    .end local v4           #iter:Ljava/util/Enumeration;
    :cond_1
    new-instance v15, Ljava/util/Random;

    invoke-direct {v15}, Ljava/util/Random;-><init>()V

    const v16, 0x7fffffff

    invoke-virtual/range {v15 .. v16}, Ljava/util/Random;->nextInt(I)I

    move-result v15

    invoke-static {v15}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v9

    .line 72
    .local v9, strNonce:Ljava/lang/String;
    invoke-static {}, Lcom/glympse/platform/common/CorrectedTime;->GetTime()J

    move-result-wide v15

    const-wide/16 v17, 0x3e8

    div-long v15, v15, v17

    invoke-static/range {v15 .. v16}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v12

    .line 75
    .local v12, strTimestamp:Ljava/lang/String;
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_consumer_key"

    move-object v0, v15

    move-object/from16 v1, v16

    move-object/from16 v2, p3

    invoke-direct {v0, v1, v2}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 76
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_nonce"

    move-object v0, v15

    move-object/from16 v1, v16

    move-object v2, v9

    invoke-direct {v0, v1, v2}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 77
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_signature_method"

    const-string v17, "HMAC-SHA1"

    invoke-direct/range {v15 .. v17}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 78
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_timestamp"

    move-object v0, v15

    move-object/from16 v1, v16

    move-object v2, v12

    invoke-direct {v0, v1, v2}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 79
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_token"

    move-object v0, v15

    move-object/from16 v1, v16

    move-object/from16 v2, p5

    invoke-direct {v0, v1, v2}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 80
    new-instance v15, Lcom/glympse/platform/common/NameValueNode;

    const-string v16, "oauth_version"

    const-string v17, "1.0"

    invoke-direct/range {v15 .. v17}, Lcom/glympse/platform/common/NameValueNode;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 83
    new-instance v15, Lcom/glympse/platform/common/OAuthJob$CompareNameValueNodes;

    invoke-direct {v15}, Lcom/glympse/platform/common/OAuthJob$CompareNameValueNodes;-><init>()V

    invoke-virtual {v5, v15}, Lcom/glympse/platform/GVector$NameValueNodes;->Sort(Lcom/glympse/platform/GComparator;)V

    .line 86
    new-instance v13, Ljava/lang/StringBuffer;

    invoke-direct {v13}, Ljava/lang/StringBuffer;-><init>()V

    .line 87
    .local v13, strbufParams:Ljava/lang/StringBuffer;
    invoke-virtual {v5}, Lcom/glympse/platform/GVector$NameValueNodes;->elements()Ljava/util/Enumeration;

    move-result-object v4

    .restart local v4       #iter:Ljava/util/Enumeration;
    :goto_1
    invoke-interface {v4}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v15

    if-nez v15, :cond_4

    .line 104
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "POST&"

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static/range {p2 .. p2}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const/16 v16, 0x26

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v13}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 107
    .local v11, strSig:Ljava/lang/String;
    new-instance v15, Ljava/lang/StringBuilder;

    invoke-static/range {p4 .. p4}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v16

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const/16 v16, 0x26

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 108
    invoke-static/range {p6 .. p6}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 107
    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    .line 111
    .local v8, strKey:Ljava/lang/String;
    invoke-static {v11, v8}, Lcom/glympse/platform/Platform;->CalculateHMACSHA1(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    .line 114
    .local v7, strHMAC:Ljava/lang/String;
    move-object/from16 v0, p2

    move-object/from16 v1, p0

    iput-object v0, v1, Lcom/glympse/platform/common/OAuthJob;->m_strUrl:Ljava/lang/String;

    .line 116
    const/4 v10, 0x0

    .line 117
    .local v10, strPost:Ljava/lang/String;
    if-eqz p1, :cond_6

    .line 120
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "OAuth oauth_nonce=\""

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 121
    invoke-virtual {v15, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, "\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 122
    const-string v16, "oauth_signature_method=\"HMAC-SHA1\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 123
    const-string v16, "oauth_timestamp=\""

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, "\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 124
    const-string v16, "oauth_consumer_key=\""

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-static/range {p3 .. p3}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, "\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 125
    const-string v16, "oauth_token=\""

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-static/range {p5 .. p5}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, "\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 126
    const-string v16, "oauth_signature=\""

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-static {v7}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    const-string v16, "\", "

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    .line 127
    const-string v16, "oauth_version=\"1.0\""

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    .line 120
    move-object v0, v15

    move-object/from16 v1, p0

    iput-object v0, v1, Lcom/glympse/platform/common/OAuthJob;->m_strAuthorizationHeader:Ljava/lang/String;

    .line 131
    invoke-virtual {v14}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v10

    .line 144
    :goto_2
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "Sig: "

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v15, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 145
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "Key: "

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v15, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 146
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "HMAC: "

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v15, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 147
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "Url: "

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/platform/common/OAuthJob;->m_strUrl:Ljava/lang/String;

    move-object/from16 v16, v0

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 148
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "Header: "

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/platform/common/OAuthJob;->m_strAuthorizationHeader:Ljava/lang/String;

    move-object/from16 v16, v0

    invoke-static/range {v16 .. v16}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 153
    :try_start_0
    const-string v15, "UTF-8"

    invoke-virtual {v10, v15}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v15

    move-object/from16 v0, p0

    move-object v1, v15

    invoke-virtual {v0, v1}, Lcom/glympse/platform/common/OAuthJob;->SetPostData([B)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 159
    :goto_3
    return-void

    .line 45
    .end local v7           #strHMAC:Ljava/lang/String;
    .end local v8           #strKey:Ljava/lang/String;
    .end local v9           #strNonce:Ljava/lang/String;
    .end local v10           #strPost:Ljava/lang/String;
    .end local v11           #strSig:Ljava/lang/String;
    .end local v12           #strTimestamp:Ljava/lang/String;
    .end local v13           #strbufParams:Ljava/lang/StringBuffer;
    :cond_2
    invoke-interface {v4}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/glympse/platform/common/NameValueNode;

    .line 48
    .local v6, oCur:Lcom/glympse/platform/common/NameValueNode;
    invoke-virtual {v5, v6}, Lcom/glympse/platform/GVector$NameValueNodes;->addElement(Ljava/lang/Object;)V

    .line 57
    if-eqz p1, :cond_0

    .line 59
    invoke-virtual {v14}, Ljava/lang/StringBuffer;->length()I

    move-result v15

    if-lez v15, :cond_3

    .line 61
    const/16 v15, 0x26

    invoke-virtual {v14, v15}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 63
    :cond_3
    iget-object v15, v6, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 64
    const/16 v15, 0x3d

    invoke-virtual {v14, v15}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 65
    iget-object v15, v6, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto/16 :goto_0

    .line 89
    .end local v6           #oCur:Lcom/glympse/platform/common/NameValueNode;
    .restart local v9       #strNonce:Ljava/lang/String;
    .restart local v12       #strTimestamp:Ljava/lang/String;
    .restart local v13       #strbufParams:Ljava/lang/StringBuffer;
    :cond_4
    invoke-interface {v4}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/glympse/platform/common/NameValueNode;

    .line 92
    .restart local v6       #oCur:Lcom/glympse/platform/common/NameValueNode;
    invoke-virtual {v13}, Ljava/lang/StringBuffer;->length()I

    move-result v15

    if-lez v15, :cond_5

    .line 94
    const/16 v15, 0x26

    invoke-virtual {v13, v15}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 98
    :cond_5
    iget-object v15, v6, Lcom/glympse/platform/common/NameValueNode;->m_strName:Ljava/lang/String;

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v13, v15}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 99
    const/16 v15, 0x3d

    invoke-virtual {v13, v15}, Ljava/lang/StringBuffer;->append(C)Ljava/lang/StringBuffer;

    .line 100
    iget-object v15, v6, Lcom/glympse/platform/common/NameValueNode;->m_strValue:Ljava/lang/String;

    invoke-static {v15}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-static {v15}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v13, v15}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    goto/16 :goto_1

    .line 140
    .end local v6           #oCur:Lcom/glympse/platform/common/NameValueNode;
    .restart local v7       #strHMAC:Ljava/lang/String;
    .restart local v8       #strKey:Ljava/lang/String;
    .restart local v10       #strPost:Ljava/lang/String;
    .restart local v11       #strSig:Ljava/lang/String;
    :cond_6
    new-instance v15, Ljava/lang/StringBuilder;

    const-string v16, "&oauth_signature="

    invoke-direct/range {v15 .. v16}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {v7}, Lcom/glympse/platform/common/OAuthJob;->OAuthEncode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v16

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v13, v15}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 141
    invoke-virtual {v13}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v10

    goto/16 :goto_2

    .line 155
    :catch_0
    move-exception v15

    move-object v3, v15

    .line 157
    .local v3, e:Ljava/lang/Exception;
    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto/16 :goto_3
.end method
